import {Component, Input} from '@angular/core';
import {NgClass, NgIf} from "@angular/common";

@Component({
  selector: 'app-index-part1',
  standalone: true,
  imports: [
    NgIf,
    NgClass
  ],
  templateUrl: './index-part1.component.html',
  styleUrl: './index-part1.component.scss'
})
export class IndexPart1Component {
  @Input() dataid: string = '';
  @Input() h1class: string = '';
  @Input() h5class: string = '';
  @Input() pclass: string = '';
  @Input() count: number = 0;
  @Input() showhr: boolean = true;
  @Input() left: string = '';
  @Input() right: string = '';
  @Input() none: string = '';
  @Input() grid: string = '';

  ngAfterViewInit() {
    setTimeout(() => {
      // console.log(this.dataid, this.count)
      const numAnim = new countUp.CountUp(this.dataid, this.count);
      numAnim.start()
      // const countUp = new CountUp('count', this.count);
      // if (!countUp.error) {
      //   countUp.start();
      // } else {
      //   console.error(countUp.error);
      // }
    })
  }
}
